﻿@using QunProject.Common;
@{
    Layout = "~/Views/Shared/_Layout.cshtml";
    var LoginMember = (QunProject.Model.member)ViewBag.LoginMember;
}

<div class="layui-container p0 mt10">
    <div class="row">
        <div class="layui-col-md2 bcolor p10">
            <div class="row">
                <div class="layui-col-md12" id="dot_member_img"></div>

                <script id="dot_tmp_member_img" type="text/x-dot-template">
                    <img src="{{= _Member_Img_Url }}" style="width:173px;height:173px;" onerror="memberImageError(event)" />
                </script>
                <div class="layui-col-md12 pt10 mb10">
                    <p class="pl10"><a href="javascript:void(0)" style="font-size:18px;">@LoginMember.Name</a></p>
                    <p class="pl10" style="margin-top:5px;"><a href="javascript:void(0)" style="color:#aaa;">@LoginMember.Phone.SubPhoneStr()</a></p>
                    <p class="pl10" style="margin-top:5px;"><a href="/login/exit@(ViewBag.Suffix)" class="href">退出登录</a></p>
                </div>
            </div>
            <hr style="margin-bottom:0;" />
            <div class="row member_menu">
                <ul>
                    <li><a href="/Member/Index@(ViewBag.Suffix)" id="member-nav-index">个人中心</a> </li>
                    <li><a href="/Member/Info@(ViewBag.Suffix)" id="member-nav-info">个人资料</a> </li>
                    <li><a href="/Member/Safety@(ViewBag.Suffix)" id="member-nav-safety">安全中心</a> </li>
                    <li><a href="/Member/Special@(ViewBag.Suffix)" id="member-nav-special">我的专题</a> </li>
                    <li><a href="/Member/Article@(ViewBag.Suffix)" id="member-nav-article">我的文章</a> </li>
                    <li><a href="/Member/Discuss@(ViewBag.Suffix)" id="member-nav-discuss">我的讨论</a> </li>
                    <li><a href="/Member/Reply@(ViewBag.Suffix)">我的回复</a> </li>
                    <li><a href="/Page/Index/@LoginMember.Number@(ViewBag.Suffix)" target="_blank">个人主页</a> </li>
                </ul>
            </div>
        </div>
        <div class="layui-col-md10">
            @RenderBody()
        </div>
    </div>
</div>

<script>
    var _Member_Img_Url = fileurl + '@LoginMember.Img';
    $(function () {
        var dotTmp = doT.template($("#dot_tmp_member_img").text());
        $("#dot_member_img").html(dotTmp(null));
    });

    var webUrl = window.location.href.toLowerCase();
    if (webUrl.indexOf("/member/index") > -1) {
        $("#member-nav-index").addClass("href");
    } else if (webUrl.indexOf("/member/info") > -1) {
        $("#member-nav-info").addClass("href");
    } else if (webUrl.indexOf("/member/safety") > -1 || webUrl.indexOf("/article/speciallist") > -1) {
        $("#member-nav-safety").addClass("href");
    } else if (webUrl.indexOf("/member/special") > -1) {
        $("#member-nav-special").addClass("href");
    } else if (webUrl.indexOf("/member/article") > -1) {
        $("#member-nav-article").addClass("href");
    } else if (webUrl.indexOf("/member/discuss") > -1) {
        $("#member-nav-discuss").addClass("href");
    }else {
        $("#member-nav-index").addClass("href");
    }
</script>